<!--大小额贷记退汇录入-->
<template>
  <div class="app-container">
    <ht-search-form
      :dictMap="dictMap"
      :queryParams="queryParams"
      :outputQueryParams="queryParams"
      :formOptions="formOptions"
      :advOptions="[]"
      :labelWidth="80"
    >
    </ht-search-form>
    <ht-table
      ref="dataTable"
      rowKey="id"
      :showSerialNumber="false"
      :multi-select="false"
      :dictMap="dictMap"
      :reqConfig="reqConfig"
      :queryParams="queryParams"
      :tableBindColumns="tableBindColumns"
    >
      <template v-slot:operate>
        <el-table-column label="操作" align="left" width="120" fixed="right" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <ht-button-group
              :buttonList="[
                {
                  label: '明细',
                  doFunc: () => {
                    toViewDetail(scope.row);
                  },
                }
              ]"
            />
          </template>
        </el-table-column>
      </template>
    </ht-table>
    <query-detail-dialog ref="queryDetailDialog" @editComplete="editComplete" :dictMap="dictMap"></query-detail-dialog>
  </div>
</template>
<script>

import { apiUrlConfig } from "@/api/cnaps/baseBiz/return/check/index";
import QueryDetailDialog from "./components/Details";
import { listPageMixin } from "@/libs/listPageMixin";
import AmountRangeSearch from "@/views/components/AmountSearchInput";
export default {
  name: "baseBizReturnCheckIndex",
  mixins: [listPageMixin],
  components: {
    AmountRangeSearch,
    QueryDetailDialog,
  },
  data() {
    return {
      reqConfig: apiUrlConfig,
      //数据字典
      searchFormDictList: [
        "TXN_STATUS","PRIORITY3CODE"
      ],
      // 日期范围
      dateRange: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        idSeqno: '',
        oIdSeqno: '',
        vdate1: '',
        vdate2: ''
      },
      formOptions: [],
      tableBindColumns: [
        { label: `交易流水号`, prop: "id", width: "160" },
        { label: `原交易流水号`, prop: "oriId", width: "160" },
        { label: `CPG日期`, prop: "vdate", sortable: false, width: 160 },
        { label: `工作日期`, prop: "workdate", sortable: false, width: 160 },
        { label: `付款人名称`, prop: "payerName", width: 200 },
        { label: `金额`, prop: "amount", type: "price", sortable: false },
        { label: `录入操作员`, prop: "mdTlrno", width: 200 },
        { label: `录入时间`, prop: "mdTime", width: 200 },
      ],
    };
  },
  mounted() {
    this.formOptions = [
      {
        type: "input",
        prop: "idSeqno",
        defaultAttr: {
          label: "交易流水号",
          placeholder: "请输入交易流水号",
        },
      },
      {
        type: "input",
        prop: "oIdSeqno",
        defaultAttr: {
          label: "原流水号",
          placeholder: "请输入交易流水号",
        },
      },
      {
        type: "dates",
        nameObj: {
          startTimeName: "vdate1",
          endTimeName: "vdate2",
        },
        defaultAttr: {
          label: "CPG日期",
          placeholder: ["请输入开始日期", "请输入结束日期"],
          format: "yyyy-MM-dd",
          valueFormat: "yyyyMMdd",
        },
      }
    ];
  },
  methods: {
    editComplete(state) {
      if (state == true) {
        this.getList();
      }
    },
    /** todo 查询当天操作员的交易记录 */
    getList() {
      this.doQuery();
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /*查看明细*/
    toViewDetail(row) {
      this.$refs.queryDetailDialog.show(row.id);
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}
</style>
